package com.wlan.dao.common;

import junit.framework.TestCase;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 此类意在启动Spring,其它单元测试类继承此类即可
 * 
 * @author zz
 * @date 2012-5-10
 * @email charles.zz.life@gmail.com
 */
public abstract class AbstractTestCase extends TestCase {

	private ApplicationContext ctx;

	@Override
	protected void setUp() throws Exception {
		try {
			// TODO Auto-generated method stub
			super.setUp();
			ctx = new ClassPathXmlApplicationContext(
					new String[] { "spring-applicationContext.xml" });
			System.out.println("启动Spring成功");
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
	}

	public ApplicationContext getCtx() {
		return ctx;
	}

}
